/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package genomemap.data;

import java.io.Serializable;

/**
 * all data (physical,genetic,sequence) properties for a single chromosome.
 * @author Susanta Tewari
 * @version 1.0
 * @created 19-Nov-2007 8:54:43 PM
 */
public class ChData implements Serializable {

    /** Field description */
    private static final long serialVersionUID = 42L;

    /**
     * physical length of the chromosome indicated by ch_id
     */
    private int chLength = 0;

    /**
     * number of clones
     */
    private int cloneCount = 0;

    /**
     * physical length of a single clone
     */
    private int cloneLength = 0;

    /**
     * Hybridization ChData in the order set
     */
    private String hybridDataFilePath = null;

    /**
     * number of probes
     */
    private int probeCount = 0;

    /**
     * Probability of false positive
     */
    private double probFalsePos = 0.00002;

    /**
     * probability of false negative
     */
    private double probFalseNeg = 0.00002;

    /**
     * chromosome id should be from 1 to 7
     */
    private int ch_id = -1;

    /**
     * file path for the rflp data of the corresponding chromosome.
     */
    private String rflpDataFilePath = null;

    /**
     * maximum odd number of genes available for this chromosome.
     */
    private int geneCount = 0;

    /**
     * the name of the table containing the hybridization data.
     */
    private String hybridTable = null;

    /**
     * Constructs ...
     */
    public ChData() {}

    public int getChLength() {
        return chLength;
    }

    /**
     * number of clones
     */
    public int getCloneCount() {
        return cloneCount;
    }

    /**
     * physical length of a single clone
     */
    public int getCloneLength() {
        return cloneLength;
    }

    /**
     * number of probes
     */
    public int getProbeCount() {
        return probeCount;
    }

    /**
     * Probability of false positive
     */
    public double getProbFalsePos() {
        return probFalsePos;
    }

    /**
     * probability of false negative
     */
    public double getProbFalseNeg() {
        return probFalseNeg;
    }

    /**
     * physical length of the chromosome indicated by ch_id
     *
     * @param newVal
     */
    public void setChLength(int newVal) {
        chLength = newVal;
    }

    /**
     * number of clones
     *
     * @param newVal
     */
    public void setCloneCount(int newVal) {
        cloneCount = newVal;
    }

    /**
     * physical length of a single clone
     *
     * @param newVal
     */
    public void setCloneLength(int newVal) {
        cloneLength = newVal;
    }

    @Override
    public boolean equals(Object obj) {

        if (obj instanceof ChData) {

            ChData pData = (ChData) obj;

            return ch_id == pData.getChId();
        }

        return false;
    }

    @Override
    public int hashCode() {
        return new Integer(ch_id).hashCode();
    }

    /**
     * number of probes
     *
     * @param newVal
     */
    public void setProbeCount(int newVal) {
        probeCount = newVal;
    }

    /**
     * Probability of false positive
     *
     * @param newVal
     */
    public void setProbFalsePos(double newVal) {
        probFalsePos = newVal;
    }

    /**
     * probability of false negative
     *
     * @param newVal
     */
    public void setProbFalseNeg(double newVal) {
        probFalseNeg = newVal;
    }

    /**
     * chromosome id should be from 1 to 7
     */
    public int getChId() {
        return ch_id;
    }

    /**
     * Hybridization ChData in the order set
     */
    public String getHybridDataFilePath() {
        return hybridDataFilePath;
    }

    /**
     * chromosome id should be from 1 to 7
     *
     * @param newVal
     */
    public void setChId(int newVal) {
        ch_id = newVal;
    }

    /**
     * Hybridization ChData in the order set
     *
     *
     * @param newVal
     */
    public void setHybridDataFilePath(String newVal) {
        hybridDataFilePath = newVal;
    }

    /**
     * file path for the rflp data of the corresponding chromosome.
     */
    public String getRflpDataFilePath() {
        return rflpDataFilePath;
    }

    /**
     * file path for the rflp data of the corresponding chromosome.
     *
     * @param newVal
     */
    public void setRflpDataFilePath(String newVal) {
        rflpDataFilePath = newVal;
    }

    public int getGeneCount() {
        return geneCount;
    }

    public void setGeneCount(int geneCount) {
        this.geneCount = geneCount;
    }

    public String getHybridTable() {
        return hybridTable;
    }

    public void setHybridTable(String hybridTable) {
        this.hybridTable = hybridTable;
    }
}
